<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.liangjie.bbs.Article"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="com.liangjie.bbs.DB"%>
<%@page import="java.sql.Connection"%>
<%@page pageEncoding="utf-8"%>

<%
	String idStr = request.getParameter("id");
	if (idStr == null || idStr.trim().equals("")) {
		out.println("参数错误！");
		return;
	}

	int id = 0;
	try {
		id = Integer.parseInt(idStr);
	} catch (NumberFormatException e) {
		out.println("参数错误！");
		return;
	}

	Connection conn = DB.getConn();
	Statement stmt = DB.getStmt(conn);
	String sql = "select * from article where id = " + id;
	ResultSet rs = DB.executeQuerey(stmt, sql);
	Article article = null;

	if (rs.next()) {
		article = new Article();
		article.initFromJsp(rs);

	}

	DB.close(rs);
	DB.close(stmt);
	DB.close(conn);

	if (article == null) {
		out.println("帖子不存在！");
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>帖子详情——<%=article.getTitle()%></title>

<link rel="stylesheet" type="text/css"
	href="./sources/article_detail/style_5_common.css" />
<link rel="stylesheet" type="text/css"
	href="./sources/article_detail/style_5_forum_viewthread.css" />

<style type="text/css"></style>
<script src="./sources/article_detail/common.js" type="text/javascript"></script>

<link rel="archives" title="花粉俱乐部"
	href="http://cn.club.vmall.com/archiver/" />
<script src="./sources/article_detail/forum.js" type="text/javascript" />
<link
	href="http://static.huafans.cn/template/hw_fans/image/zh//favicon.ico"
	rel="shortcut icon" />
<link rel="stylesheet" type="text/css"
	href="./sources/article_detail/huafans_national_com.css" />
<link rel="stylesheet" type="text/css"
	href="./sources/article_detail/huafans_national.css" />
<script type="text/javascript" charset="UTF-8"
	src="./sources/article_detail/common_extra.js"></script>
<script type="text/javascript"
	src="./sources/article_detail/hianalytics.js"></script>
<script type="text/javascript"
	src="./sources/article_detail/hianalytics.js"></script>
<script type="text/javascript" charset="utf-8"
	src="./sources/article_detail/ClubMapping.js"></script>
<link href="./sources/article_detail/bdsstyle.css" rel="stylesheet"
	type="text/css" />

</head>
<body id="nv_forum" class="pg_viewthread"
	onkeydown="if(event.keyCode==27) return false;">

	<div id="append_parent"></div>
	<div id="ajaxwaitid"></div>
	<div id="toptb" class="cl">
		<div class="topbar-bg">
			<div class="wp"></div>
		</div>
	</div>

	<div id="wp" class="wp">

		<script src="./sources/article_detail/forum_viewthread.js"
			type="text/javascript"></script>

		<!--[diy=diynavtop]-->
		<div id="diynavtop" class="area"></div>
		<!--[/diy]-->
		<div class="wp">
			<!--[diy=diy1]-->
			<div id="diy1" class="area"></div>
			<!--[/diy]-->
		</div>
		<div id="ct" class="wp ct2 cl">
			<div class="mn">
				<div id="postlist" class="pl bm">
					<table cellspacing="0" cellpadding="0">
						<tbody>
							<tr>
								<td class="plc ptm pbn vwthd">
									<h1 class="ts">
										<a
											href="http://cn.club.vmall.com/forum.php?mod=forumdisplay&fid=915&filter=typeid&typeid=2073">[bbs论坛]</a>
										<span id="thread_subject"><%=article.getTitle()%></span>
									</h1> <!--[TODO]帖子标题 [end] --> <!--[TODO]复制链接 [begin] --> <span
									class="xg1"> &nbsp;<img
										src="./sources/article_detail/hot_3.gif" alt=""
										title="热度: 1723" /> <a
										onclick = "alert('功能尚未开放，感谢您的关注！')">[复制帖子标题和链接]</a>
								</span>
									<p class="pdh-misc">
										<span class="hbw-ico hbwi-view14" title="查看">407274</span><span
											class="hbw-ico hbwi-reply14" title="回复">16792</span>

										<!--发表回复按钮
										<button type="button" style="float:right; margin-right:0;"
											value="replysubmit" tabindex="5">
											<strong>发表回复</strong>
										</button>
										发表回复按钮-->


									</p> <!--[TODO] 显示“查看数”和“回复数” [end] -->

								</td>
							</tr>

						</tbody>

					</table>

					<!--[TODO]分割线 [begin] -->
					<table cellspacing="0" cellpadding="0" class="ad">
						<tbody>
							<tr>
								<td class="pls"></td>
							</tr>
						</tbody>
					</table>
					<!--[TODO]分割线 [end] -->


					<!--[TODO]已发表和回复的帖子列表 [begin] -->
					<div id="post_70746702">
						<!--[TODO]执行此分支 -->

					</div>

					<!--帖子开始-->
					<div id="post_70753812">
						<table id="pid70753812" class="plhin" summary="pid70753812"
							cellspacing="0" cellpadding="0">
							<tbody>
								<tr>

									<!--[TODO]右侧框（帖子信息） [begin] -->
									<td class="plc" style="width:100%">
										<div class="pi">
											<!--[TODO]显示“楼主” deleted [begin] -->
											<strong> <a href="" id="postnum70753812"> 沙发</a> <!--[TODO] 显示“只看该作者”或“显示全部楼层” [begin] -->
												<a href="" rel="nofollow">只看该作者</a> <!--[TODO] 显示“只看该作者”或“显示全部楼层” [end] -->
											</strong>
											<!--[TODO]显示“楼主” [end] -->

											<!-- <div class="pti pdh-avatar"> -->
											<div class="pti">
												<div class="pdbt"></div>

												<!--[TODO] 显示作者的头像 [begin] -->
												<div class="authi">
													<a href="space-uid-7585363.html" target="_blank"
														class="xi2 z" style="padding-right:10px;"><img
														src="./sources/article/bagua.png" /></a> <a href=""
														target="_blank" class="xi2">Liangjie </a> &nbsp;<em>梁杰</em>&nbsp;
													<!--楼主帖，显示回复该主题的最新时间；其他的回复贴，只需要自身的发帖时间即可-->
													<em id="authorposton70753812">发表于 <span
														title="2015-6-15 18:10:21"><%=new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss")
					.format(article.getpDate())%>&nbsp;</span></em> <em class="fmty">来自：浏览器</em>

												</div>

											</div>

										</div> <!--[TODO]帖子信息-发表于**天前、只看见作者、只看大图 [end] -->

										<div class="pct">
											<div class="pcb">
												<!--[TODO]执行此分支 -->
												<div class="t_fsz">
													<!--[TODO]class="t_fsz" -->
													<table cellspacing="0" cellpadding="0">
														<tbody>
															<tr>
																<td class="t_f" id="postmessage_70753812"><%=article.getCont()%></td>
															</tr>
														</tbody>
													</table>
												</div>

												<!--[TODO]点评记录 [begin] -->
												<div id="comment_70753812" class="cm"></div>
												<!--[TODO]点评记录 [end] -->

												<!--[TODO]执行此分支，但页面上没有看出来在哪里 -->
												<div id="post_rate_div_70753812"></div>
											</div>
										</div> <!--[TODO]不执行此分支 -->
									</td>
								</tr>
								<!--[TODO]右侧框（帖子信息） [end] -->

								<!--[TODO]右侧框，整个显示"收藏、评分、支持/反对" [begin] -->
								<!--[TODO]右侧框，整个显示"收藏、评分、支持/反对" [end] -->
								<!--[TODO]右侧框，显示"回复、编辑、推送" [begin] -->
								<!--[TODO]右侧框，显示"回复、编辑、推送" [end] -->
								<!--[TODO]显示一条线，没有具体内容[begin] -->
								<tr class="ad">
									<td class="pls"></td>
								</tr>
								<!--[TODO]显示一条线，没有具体内容[end] -->
							</tbody>
						</table>
					</div>
					<!--帖子结束-->



					<div id="post_70754067"></div>
					<div id="post_70754216"></div>
					<div id="post_70754508"></div>
					<div id="post_70760064"></div>
					<div id="post_70760966"></div>
					<div id="post_70761651">
						<table id="pid70761651" class="plhin" summary="pid70761651"
							cellspacing="0" cellpadding="0">
							<tbody>
								<!--[TODO]右侧框（帖子信息） [end] -->

								<!--[TODO]右侧框，整个显示"收藏、评分、支持/反对" [begin] -->
								<!--[TODO]右侧框，整个显示"收藏、评分、支持/反对" [end] -->
								<!--[TODO]右侧框，显示"回复、编辑、推送" [begin] -->
								<!--[TODO]右侧框，显示"回复、编辑、推送" [end] -->
								<!--[TODO]显示一条线，没有具体内容[begin] -->
								<tr class="ad">
									<td class="pls"></td>
								</tr>
								<!--[TODO]显示一条线，没有具体内容[end] -->
							</tbody>
						</table>
					</div>
					<div id="post_70761884"></div>
					<!--[TODO]已发表和回复的帖子列表  [end] -->

					<!--[TODO]不显示 [begin] -->
					<div id="postlistreply" class="pl">
						<div id="post_new" class="viewthread_table" style="display: none"></div>
					</div>
					<!--[TODO]不显示 [end] -->

				</div>
				<form method="post" name="modactions" id="modactions">
					<input type="hidden" name="formhash" value="8baedf8c" /> <input
						type="hidden" name="optgroup" /> <input type="hidden"
						name="operation" /> <input type="hidden" name="listextra"
						value="page%3D1" /> <input type="hidden" name="page" value="1" />
				</form>

				<!--[TODO]显示“下一页” deleted [begin] -->
				<!--[TODO]显示“下一页” deleted [end] -->

				<!--[TODO]发新帖、回复、返回列表 [begin] -->
				<div class="pgs tm bm cl">

					<!-- 自定义的“发帖”、“多页列表” -->
					<div class="hbp-pager" style="padding:10px 20px;">
						<div class="pg">
							<strong>1</strong><a
								href="">2</a><a
								href="">3</a><a
								href="">4</a><a
								href="">5</a><a
								href="">6</a><a
								href="">7</a><a
								href="">8</a><a
								href="">9</a><a
								href="">10</a>
							<a href=""
								class="nxt">下一页</a>
						</div>
						<span class="pgb y"><a href="./article.jsp">返回列表</a></span> <a
							class="mkbtn-blue newpost" id="newspecialtmp"
							href="./reply.jsp?id=<%=article.getId()%>&rootId=<%=article.getRootID()%>">发表回复</a>
					</div>

					<!--[TODO]显示“发帖”、“回复” deleted [begin] -->
					<!--[TODO]显示“发帖”、“回复” deleted [end] -->

				</div>
				<!--[TODO]发新帖、回复、返回列表 [end] -->

				<!--[diy=diyfastposttop]-->
				<div id="diyfastposttop" class="area"></div>
				<!--[/diy]-->
				<!--[TODO]回复主体页面 [begin] -->
				<%--
				<div id="f_pst" class="pl bm bmw">
					<form method="post" id="fastpostform"
						action="http://cn.club.vmall.com/forum.php?mod=post&action=reply&fid=915&tid=4641783&extra=page%3D1&replysubmit=yes&infloat=yes&handlekey=fastpost"
						onsubmit="return fastpostvalidate(this)">
						<table cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<!--[TODO]左侧的用户头像  deleted [begin] -->
									<!--[TODO]左侧的用户头像 deleted [end] -->

									<td class="plc"><span id="fastpostreturn"></span>
										<div class="cl">
											<div id="fastposteditor">
												<div class="tedt mtn">
													<div class="bar">
														<span class="y"> <a
															href="http://cn.club.vmall.com/forum.php?mod=post&action=reply&fid=915&tid=4641783"
															onclick="return switchAdvanceMode(this.href)">高级模式</a>
														</span>
														<script src="./sources/article_detail/seditor.js"
															type="text/javascript"></script>
														<div class="fpd">
															<a href="javascript:;" title="文字加粗" class="fbld">B</a> <a
																href="javascript:;" title="设置文字颜色" class="fclr"
																id="fastpostforecolor">Color</a> <a id="fastpostimg"
																href="javascript:;" title="图片" class="fmg">Image</a> <a
																id="fastposturl" href="javascript:;" title="添加链接"
																class="flnk">Link</a> <a id="fastpostquote"
																href="javascript:;" title="引用" class="fqt">Quote</a> <a
																id="fastpostcode" href="javascript:;" title="代码"
																class="fcd">Code</a> <a href="javascript:;" class="fsml"
																id="fastpostsml">Smilies</a>
														</div>
													</div>
													<div class="area">
														<div class="pt hm">
															您需要登录后才可以回帖 <a
																href="http://cn.club.vmall.com/member.php?mod=logging&action=login"
																class="xi2">登录</a> | <a
																href="http://cn.club.vmall.com/member.php?mod=register"
																class="xi2">立即注册</a>
														</div>
													</div>
												</div>
											</div>
										</div> <input type="hidden" name="formhash" value="8baedf8c" /> <input
										type="hidden" name="usesig" value="" /> <input type="hidden"
										name="subject" value="  " />
										<p class="ptm pnpost"></p>
										<!--发表回复按钮-->
										<div class="hbp-pager" style="padding:0; line-height:32px;">
											<button type="button" style="float:right; margin-right:0;"
												value="replysubmit" tabindex="5">
												<strong>发表回复</strong>
											</button>
											<label for="fastpostrefresh"> <input
												id="fastpostrefresh" type="checkbox" class="pc" />
												回帖后跳转到最后一页
											</label>

										</div>
										<!--发表回复按钮-->
										</td>
								</tr>
							</tbody>
						</table>
					</form>
				</div>
			</div>
			 --%>
				<!--[TODO]回复主体页面 [end] -->

			</div>
		</div>
	</div>
	<!--[TODO]显示为一条线，没有具体内容 [begin] -->
	<div class="wp mtn">
		<!--[diy=diy3]-->
		<div id="diy3" class="area"></div>
		<!--[/diy]-->
	</div>
	<!--[TODO]显示为一条线，没有具体内容 [end] -->


	<div id="ft" class="wp cl">
		<div id="flk" class="wp mk-box">
			<p>Copyright © 2011-2013 华为软件技术有限公司 版权所有 保留一切权利</p>
		</div>
	</div>
</body>
</html>